******************************************************************************
* Replication code for:
* 
* "Does Environmental Regulation Matter for Income Inequality? 
*   New Evidence from Chinese Communities"
* 
* Authors: Bihong Huang (IMF), Ying Yao (AGI)
* 
* Date: Jan 23, 2023
******************************************************************************

** Change the working directory to reflect the local machine

global PATH "D:\Replication"

cd $PATH


** Main Data for Analysis

do "main_data.do"

** Tables

* Table 1: Summary of Statistics for Communities
do "tab1_summary.do"

* Table 2: Baseline Results
do "tab2_baseline.do"

* Table 3: Robustness Checks
do "tab3_robustness.do"

* Table 4: Heterogeneous Effect of TCZ Policy
do "tab4_heterogeneity.do"

* Table 5: Decomposition of Income
do "tab5_decomposition.do"

* Table 6: Income Distribution by Community Types
do "tab6_gini_commtype.do"


** Figures

* Figure 1: SO2 Emissions in China
do "fig1_edgar_chns.do"

* Figure 2: Income Inequality Over Time
do "fig2_ginitrend.do"

* Figure 3: Event Study of Gini Coefficient
do "fig3_eventgini.do"

* Figure 4: Trends in Sectoral SO2 Emissions
do "fig4_spillover.do"

* Figure 5: Policy Effect on Different Income Percentiles
do "fig5_percentiles.do"

* Figure 6: Wage Changes by Occupation
do "fig6_wage.do"  

* Figure 7: Trends in City Labor Market
do "fig7_labor_market.do" 

